<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title></title>
<%@ include file="/WEB-INF/views/include/easyui.jsp"%>
</head>
<body>
	<div>
		<form id="mainform" action="<%=path%>/generator/auto/add"
			method="post" enctype="multipart/form-data">
			<table class="formTable" style="text-align:right">
				<input type="hidden" name="ID" value="${r'${record'}.ID}" />
				<input type="hidden" name="BASE_FORM_LEEKO_TID" value="${genTable.id}" />
				<#list cols as col> 
					<#if  (col.formShow)??&&col.formShow == 1>
					   <tr>
							<td>${col.colComment}：</td>
							<td>
								<#if col.inputType?? && col.inputType=4>
									<textarea name="${col.colName}">${r'${record'}.${col.colName}}</textarea>
								<#else>
								<input name="${col.colName}" value="${r'${record'}.${col.colName}}"
								style="
								<#if col.colWidth??&&col.colWidth?trim!="">
								width:${col.colWidth}px;
								</#if>
								<#if col.colHeight??&&col.colHeight?trim!="">
								height:${col.colHeight}px;
								</#if>
								"
								<#if col.isEditor??&&col.isEditor==1>
								 readonly="readonly"
								</#if>
								<#if col.inputType??>
									<#if col.inputType==1>
										type="text" class="easyui-validatebox"
									<#elseif col.inputType==2>
										type="text" class="easyui-datebox easyui-validatebox" 
									<#elseif col.inputType==3>
										type="text" class="easyui-datetimebox easyui-validatebox" 
									<#elseif col.inputType==5>
									class="easyui-combobox"  data-options="valueField:'id',textField:'text',url:'<%=path%>/auto/getSelectJson?dicId=${col.dicId}'">
									<#elseif col.inputType==6>
									 type="file"
									</#if>
								<#else>
									type="text" class="easyui-validatebox"
								</#if>
								
								<#if col.validateRules?? && col.validateRules!="">
								data-options="${col.validateRules}" 
								</#if>
								/>
								</#if>
							</td>
					   </tr>
					<#else>
						<input type="hidden" value="" name="${col.colName}" />
					</#if>
				</#list>
			</table>
		</form>
	</div>
	<script type="text/javascript">
		$(function() {
			$('#mainform').form({
				onSubmit : function() {
					var isValid = $(this).form('validate');
					return isValid; // 返回false终止表单提交
				},
				success : function(data) {
					if (successTip(data, dg, d))
						dg.treegrid('reload');
				}
			});
		});
	</script>
</body>
</html>